//
//  ViewController.swift
//  CustormHUD
//
//  Created by youmy on 2018/8/3.
//  Copyright © 2018年 youmy. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func showGifLoading(_ sender: UIButton) {
        HUD.shared.showGIFLoading()
        
        DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
            HUD.shared.removeLoading()
        }
    }
    
    @IBAction func showLoading(_ sender: UIButton) {
//        HUD.shared.showLoading(background: true)
        
//        HUD.shared.showLoading(background: false, foregroundColor: .red)
        
//        HUD.shared.showLoading(background: true, bgColor: .darkGray, foregroundColor: .white)
        
//        HUD.shared.showResult(image: "success", content: "支付成功", bgColor: .darkGray)
        
//        HUD.shared.showResult(image: "failure", content: "支付失败", bgColor: .darkGray)
        
//        HUD.shared.showLoadingText(text: "加载中...")
        
        HUD.shared.showLoadingText(text: "加载中...", bgColor: .lightGray, foregroundColor: .red)
        
        DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
            HUD.shared.removeLoading()
        }
    }
    
    @IBAction func showHUD(_ sender: UIButton) {
//        HUD.shared.showText(text: "支付成功",position: .top)
        HUD.shared.showText(text: "支付成功", bgColor: .red, position: .top, second: DispatchTime.now() + 5)
    }
}

